<?php
namespace Emos\ListField;

use Emos\Common;

abstract class AbstractListField {
    var $label;
    var $dbName;
    var $width;
    
    var $needBorder = true;
    
    protected $value;        
    protected $record = array();        
    
    function __construct() {        
    }
    
    public function setWidth($width) {
        $this->width = $width;
        return $this;
    }

    public function setValueFromRecord(array $record) {
        $this->record = $record;
        $this->value  = @$record[$this->dbName];        
    }  
    
    function getHtml() {
        return Common::plain($this->value);
    }
    
    function getContainerStyles() {
        return null;
    }
}